<template>
  <div>
    <!-- 全部性能 -->
    <!-- 样本基本参数卡片视图区域 -->
    <!-- <categoryFilter ref="categoryFilter" :importDataType="'软磁样品基本参数'" @getInquiryResult="getTableInquiryResult" @resetQuery="resetQuery"></categoryFilter> -->
    <el-card class="box-card">
      <el-row :gutter="20" style="margin-right: 5px">
        <el-col :span="2" style="margin-top: 4px">
          <advancedSearch ref="advancedSearch" @getRef="getTableRef" @getInquiryResult="getTableInquiryResult" @resetQuery="resetQuery"></advancedSearch>
        </el-col>
        <!-- 快速查询 -->
        <el-col :span="2" style="margin-top: 4px">
          <fastSearch ref="fastSearch" :importDataType="'全部性能'" @getFastResult="getTableFastResult" @resetQueryKs="resetQueryKs"></fastSearch>
        </el-col>
        <el-col :span="2" style="margin-top: 4px">
          <!-- <el-button type="primary" size="mini" @click="showImport('样本基本参数', 0)">导入</el-button> -->
        </el-col>
        <!-- 自定义列 -->
        <el-col :span="2" :offset="15" style="margin-top: 4px">
          <el-popover  placement="right" width="400" trigger="click" class="tableColumnPopover">
            <div class="tableColumnDiv">
              <div class="top" style="border-bottom: 1px solid #e8e8e8; padding-bottom: 12px; display: flex; align-items: center; justify-content: space-between;">
                <div class="title">自定义列</div>
                <div class="btn">
                  <el-button type="primary" size="mini" slot="reference" @click="defaultTableColumnShow">默认勾选</el-button>
                  <el-button type="primary" size="mini" slot="reference" @click="allTableColumnShow">全部勾选</el-button>
                </div>
              </div>
              <!-- @change="tableColumnShow()" -->
              <div class="content" style="display: flex; justify-content: space-around;">
                <el-checkbox-group v-model="columnShowNameList" :min="1" style="padding: 12px 4px 4px; display: flex; flex-wrap: wrap; width: 45%; flex-direction: column;">
                  <el-checkbox v-for="(item,index) in columnShowList.slice(0, columnHalfNum)" :key="item.value" :label="item.label" :checked="columnShowList[index].isShow" v-model="columnShowList[index].isShow" class="custom-checkbox" @change="tableColumnShow(item)"/>
                </el-checkbox-group>
                <el-checkbox-group v-model="columnShowNameList" :min="1" style="padding: 12px 4px 4px; display: flex; flex-wrap: wrap; width: 45%; flex-direction: column;">
                  <el-checkbox v-for="(item,index) in columnShowList.slice(columnHalfNum, columnShowList.length)" :key="item.value" :label="item.label" :checked="columnShowList[index].isShow" v-model="columnShowList[index].isShow" class="custom-checkbox" @change="tableColumnShow(item)"/>
                </el-checkbox-group>
              </div>
            </div>
            <el-button type="primary" size="mini" slot="reference" @click.once="defaultTableColumnShow">自定义列</el-button>
          </el-popover>
        </el-col>
        <!-- 操作 -->
        <el-col :span="1" style="margin-top: 4px">
          <el-button type="primary" size="mini" @click="operationShow()">操作</el-button>
        </el-col>
      </el-row>
      <el-table ref="zongHeTable" @sort-change="tableGetSortChange" :data="parameterList" height="500px" style="margin: 10px 0 10px" @select="parameterSelect" border class="mainTable">
        <el-table-column label-class-name="DisabledSelection" type="selection" fixed="left" width="40"> </el-table-column>
        <el-table-column :key="0" :render-header="renderHeader" label-class-name="sortableShow" sortable="custom" align="center" label="编号" prop="parameterId" show-overflow-tooltip width="90px" v-if="columnShowList[0].isShow"></el-table-column>
        <el-table-column :key="1" :render-header="renderHeader" align="center" label="牌号" prop="grade" width="120px" show-overflow-tooltip v-if="columnShowList[1].isShow"></el-table-column>
        <el-table-column :key="2" :render-header="renderHeader" align="center" label="国别" prop="country" min-width="4%" show-overflow-tooltip v-if="columnShowList[2].isShow"></el-table-column>
        <el-table-column :key="3" :render-header="renderHeader" align="center" label="生产商" prop="manufacturer" min-width="4%" show-overflow-tooltip v-if="columnShowList[3].isShow"></el-table-column>
        <el-table-column :key="4" :render-header="renderHeader" align="center" label="执行标准" prop="standard" min-width="4%" show-overflow-tooltip v-if="columnShowList[4].isShow">
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click.native.stop="downLoadFileName(scope.row.standard)">{{ scope.row.standard }}</el-button>
          </template>
        </el-table-column>
        <el-table-column :key="5" :render-header="renderHeader" align="center" label="数据类型" prop="dataType" min-width="4%" show-overflow-tooltip v-if="columnShowList[5].isShow"></el-table-column>
        <el-table-column :key="6" :render-header="renderHeader" align="center" label="样品规格" min-width="4%" prop="specification" show-overflow-tooltip v-if="columnShowList[6].isShow"></el-table-column>
        <el-table-column :key="7" :render-header="renderHeader" sortable="custom" align="center" label="入库时间" min-width="4%" prop="inDate" show-overflow-tooltip v-if="columnShowList[7].isShow"></el-table-column>
        <el-table-column :key="8" :render-header="renderHeader" align="center" label="样品柜编号" min-width="4%" prop="cabinetNumber" show-overflow-tooltip v-if="columnShowList[8].isShow"></el-table-column>
        <el-table-column :key="9" :render-header="renderHeader" align="center" label="项目组" prop="projuctGroup" min-width="4%" show-overflow-tooltip v-if="columnShowList[9].isShow"></el-table-column>
        <el-table-column :key="10" :render-header="renderHeader" align="center" label="样品提供人" min-width="4%" prop="sampleProducer" show-overflow-tooltip v-if="columnShowList[10].isShow"></el-table-column>
        <el-table-column :key="11" :render-header="renderHeader" align="center" label="数据来源" min-width="4%" prop="dataSource" show-overflow-tooltip v-if="columnShowList[11].isShow">
          <template slot-scope="scope">
            <el-button type="text" size="mini" @click.native.stop="downloadAttachment(scope.row.dataSource)">{{ scope.row.dataSource }}</el-button>
          </template>
        </el-table-column>
        <el-table-column :key="12" align="center" label="备注" prop="remarks" show-overflow-tooltip :render-header="renderHeader" min-width="4%" v-if="columnShowList[12].isShow"></el-table-column>
        <el-table-column align="center" fixed="right" label="操作" width="70px" v-if="isOperationShow">
          <template slot-scope="scope">
            <!-- <el-button type="text" v-if="starflag" @click="changeStar">
              <i class="el-icon-star-on"></i>
            </el-button>
            <el-button type="text" v-else @click="changeStar">
              <i class="el-icon-star-off"></i>
            </el-button>
            <el-divider direction="vertical"></el-divider> -->
            <!-- <span style="margin:0 13px 0 13px">
              <el-badge style="margin: 5px 0 0 0" :value="scope.row.commentsCount === 0 ? '' : scope.row.commentsCount" :max="50" class="item" type="primary">
                <el-button type="text" size="mini" @click="getComment(scope.row.id)">评论</el-button>
              </el-badge>
            </span>
            <el-divider direction="vertical"></el-divider> -->

            <el-button type="text" size="mini" @click="getFocusOn(scope.row)">关注</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- 分页区 -->
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pageNum" :page-sizes="[10, 20]" :page-size="queryInfo.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
    </el-card>

    <el-tabs style="margin-top: 10px" tab-position="top">
      <!-- <el-tab-pane label="测量统计">
        <measureStatistics ref="measureStatistics" :conditionNum="conditionNum" :importDataType="importDataType"></measureStatistics>
      </el-tab-pane> -->
      <el-tab-pane label="测量条件">
        <!-- 测量条件卡片视图区域 -->
        <measureSelect ref="measureSelect" :conditionNum="conditionNum" :importDataType="importDataType" :tableRow="tableRow" :transConditionInfo="conditionInfo" @echartsLegend="addChart"></measureSelect>
        <!-- 图表展示卡片视图区域 -->
        <el-card class="box-card" style="margin-top: 10px">
          <div slot="header">
            <span style="color:#4e9efd;font-size:17px;">图表展示</span>
          </div>
          <el-row :gutter="20">
            <el-col :span="3">
              <el-button size="mini" style="width:160px; margin-right: 20px" type="primary" v-model="dataZoomType" @click="changeDataZoom(dataZoomType)">切换缩放模式:{{dataZoomType == 'slider' ? '鼠标滚动' : '滑动条'}}</el-button>
            </el-col>
            <el-col :span="2" v-if="conditionInfo.curveTypes == '磁化曲线' || conditionInfo.curveTypes == '铁损曲线'">
              <el-button :type="indexEnlargeXtype" @click="indexEnlargeX" style="width:100px;" size="mini">{{ indexEnlargeXName(indexEnlargeXStatus) }}</el-button>
            </el-col>
            <el-col :span="2" v-if="conditionInfo.curveTypes == '磁化曲线' || conditionInfo.curveTypes == '铁损曲线'">
              <el-button :type="indexEnlargeType" @click="indexEnlarge" style="width:100px" size="mini">{{ indexEnlargeName(indexEnlargeStatus) }}</el-button>
            </el-col>
          </el-row>
          <div id="main" :style="`height:${graphHeight}px;width:${graphWidth}px`"></div>
        </el-card>

        <!-- 测量数据卡片区 -->
        <el-card class="box-card" style="margin-top: 10px">
          <div slot="header">
            <span style="color:#4e9efd;font-size:17px;">测量数据</span>
          </div>
          <el-row :gutter="20">
            <el-col :span="2">
              <el-button size="mini" type="primary" style="width:100px" @click="exportMeasureData">txt文件导出</el-button>
            </el-col>
            <el-col :span="2" v-if="conditionInfo.curveTypes == '磁化曲线'">
              <el-button size="mini" type="primary" style="width:140px" @click="exportTabDataVisible = true">有限元软件数据导出</el-button>
            </el-col>
          </el-row>
          <!-- 动态生成表头 -->
          <el-table height="300px" style="margin-top: 10px; width: 50%" border :data="measureList">
            <template v-for="(item, index) in measureHead">
              <el-table-column :prop="item.name" :label="item.label" :key="index" v-if="item.name != 'id'" align="center"></el-table-column>
            </template>
          </el-table>
        </el-card>
      </el-tab-pane>
      <el-tab-pane label="详细信息">
        <!-- 测量数据卡片视图区域 -->
        <measureDetailed ref="measureDetailed"></measureDetailed>
      </el-tab-pane>
    </el-tabs>
    <el-dialog :visible.sync="commentDialog" width="60%" :close-on-click-modal="false">
      <el-card>
        <!-- 评论区 -->
        <el-input clearable v-model="newComment" placeholder="说的什么......" style="width: 400px; margin-left: 10px" @keyup.enter.native="addNewComment(commentId)"></el-input>
        <el-row :gutter="20" style="margin-top: 20px; margin-bottom: 10px">
          <el-col :span="6" style="font-size: 20px"> 对这条数据的评论 </el-col>
        </el-row>
        <el-divider></el-divider>
        <div v-for="(item, index) in comment" :key="index" style="margin-left: 10px">
          <div>
            <i class="el-icon-user"></i>{{ item.nickname }}：
            {{ item.content }}
            <el-button type="text" :disabled="flag !== -1" @click="replyComment(item.id)"><i class="el-icon-chat-dot-round"></i></el-button>
            <span>{{ item.createTime }}</span>
            <div style="margin-left: 20px">
              <div v-if="flag == item.id">
                @{{ item.nickname }}:
                <el-input v-model="reply" style="width: 200px" @keyup.enter.native="addComment(item)" @blur="showComment"> </el-input>
                <el-button style="margin: 0 10px" type="primary" @click="addComment(item)">发送</el-button>
                <el-button @click="cancelComment">取消</el-button>
              </div>
            </div>
            <el-divider v-if="!item.commentNum"></el-divider>
            <el-divider v-else content-position="left">
              <span @click="foldComment(index)" v-if="isfold[index]" :key="index"
                >展开{{ item.commentNum }}条回复
                <i class="el-icon-caret-bottom"></i>
              </span>
              <span @click="foldComment(index)" v-else :key="index + '1'"
                >收起
                <i class="el-icon-caret-top"></i>
              </span>
            </el-divider>
            <div v-if="!isfold[index]" v-for="(it, index1) in item.replyComments" style="margin-left: 50px" :key="index1">
              <i class="el-icon-user"></i>{{ it.nickname }} 回复 {{ it.parentNickname }}： {{ it.content }}
              <el-button type="text" :disabled="flag !== -1" @click="replyComment1(it.id)"><i class="el-icon-chat-dot-round"></i></el-button>
              <span>{{ it.createTime }}</span>
              <div style="margin-left: 20px">
                <div v-if="flag == it.id">
                  @{{ it.nickname }}:
                  <el-input v-model="reply" style="width: 200px" @keyup.enter.native="addComment(it)" @blur="showComment"> </el-input>
                  <el-button style="margin: 0 10px" type="primary" @click="addComment(it)">发送</el-button>
                  <el-button @click="cancelComment">取消</el-button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-card>
    </el-dialog>

    <el-dialog title="提示" :visible.sync="importTag" width="60%">
      <div style="font-size: 20px; margin-left: 40px">请下载导入模板进行导入</div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" style="margin-right: 20px" @click="showDataImport">先导一条</el-button>
        <el-button type="primary" style="margin-right: 20px" @click="exportData">下载模板</el-button>
        <a-upload name="file" :action="uploadUrl" accept=".xls,.xlsx" :data="paramData" :multiple="true" @change="handleChange" :showUploadList="false">
          <el-button type="primary">已有模板，立即导入</el-button>
        </a-upload>
      </span>
    </el-dialog>
    <!-- 导入一条数据对话框 -->
    <el-dialog title="提示" :visible.sync="importOneDataVisible" width="90%">
      <el-form :inline="true">
        <el-form-item label="牌号:" label-width="170px">
          <el-input v-model="importParamter.grade"></el-input>
        </el-form-item>
        <el-form-item label="样品规格:" label-width="170px">
          <el-select v-model="importParamter.specification" placeholder="请选择" style="width: 194px">
            <el-option v-for="item in sizeList" :key="item.name" :label="item.name" :value="item.name"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="国别:" label-width="170px">
          <el-input v-model="importParamter.country"></el-input>
        </el-form-item>
        <el-form-item label="执行标准:" label-width="170px">
          <el-select v-model="importParamter.standard" placeholder="请选择" style="width: 190px">
            <el-option v-for="item in standardList" :key="item.rule_number" :label="item.rule_number" :value="item.rule_number"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="生产商:" label-width="170px">
          <el-select v-model="importParamter.manufacturer" placeholder="请选择" style="width: 194px">
            <el-option v-for="item in supplierList" :key="item.producer" :label="item.producer" :value="item.producer"> </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="数据类型:" label-width="170px">
          <el-input v-model="importParamter.dataType"></el-input>
        </el-form-item>
        <el-form-item label="标称密度/(kg/m³):" label-width="170px">
          <el-input v-model="importParamter.nominalDensity"></el-input>
        </el-form-item>
        <el-form-item label="材料类型:" label-width="170px">
          <el-input v-model="importParamter.materialsType"></el-input>
        </el-form-item>
        <el-form-item label="生产工艺:" label-width="170px">
          <el-input v-model="importParamter.manufacturingTechnique"></el-input>
        </el-form-item>
        <el-form-item label="剩磁Br/:" label-width="170px">
          <el-input v-model="importParamter.remanence"></el-input>
        </el-form-item>
        <el-form-item label="矫顽力Hcb:" label-width="170px">
          <el-input v-model="importParamter.coercivity"></el-input>
        </el-form-item>
        <el-form-item label="内禀矫顽力Hcj:" label-width="170px">
          <el-input v-model="importParamter.intrinsicCoercivity"></el-input>
        </el-form-item>
        <el-form-item label="最大磁能积:" label-width="170px">
          <el-input v-model="importParamter.maximumMagnetic"></el-input>
        </el-form-item>
        <el-form-item label="电导率:" label-width="170px">
          <el-input v-model="importParamter.specificConductance"></el-input>
        </el-form-item>
        <el-form-item label="回复磁导率:" label-width="170px">
          <el-input v-model="importParamter.recoilPermeability"></el-input>
        </el-form-item>
        <el-form-item label="热导率/(W/m-k):" label-width="170px">
          <el-input v-model="importParamter.heatConductivity"></el-input>
        </el-form-item>
        <el-form-item label="杨氏模量:" label-width="170px">
          <el-input v-model="importParamter.youngModulus"></el-input>
        </el-form-item>
        <el-form-item label="韦氏硬度:" label-width="170px">
          <el-input v-model="importParamter.hw"></el-input>
        </el-form-item>
        <el-form-item label="Br可逆温度系数:" label-width="170px">
          <el-input v-model="importParamter.brReversibleTemperature"></el-input>
        </el-form-item>
        <el-form-item label="Hcj可逆温度系数:" label-width="170px">
          <el-input v-model="importParamter.hcjReversibleTemperature"></el-input>
        </el-form-item>
        <el-form-item label="居里温度:" label-width="170px">
          <el-input v-model="importParamter.curiePoint"></el-input>
        </el-form-item>
        <el-form-item label="最高工作温度:" label-width="170px">
          <el-input v-model="importParamter.maximumTemperature"></el-input>
        </el-form-item>
        <el-form-item label="项目组:" label-width="170px">
          <el-input v-model="importParamter.projuctGroup"></el-input>
        </el-form-item>
        <el-form-item label="样品柜编号:" label-width="170px">
          <el-input v-model="importParamter.cabinetNumber"></el-input>
        </el-form-item>
        <el-form-item label="样品提供人:" label-width="170px">
          <el-input v-model="importParamter.sampleProducer"></el-input>
        </el-form-item>
        <el-form-item label="入库日期:" label-width="170px">
          <el-input v-model="importParamter.inDate"></el-input>
        </el-form-item>
        <el-form-item label="备注:" label-width="170px">
          <el-input v-model="importParamter.remarks"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button
          type="primary"
          style="margin-right: 20px"
          @click="
            importOneDataVisible = false
            importTag = false
          "
          >取消</el-button
        >
        <el-button type="primary" style="margin-right: 20px" @click="importOneParamter">导入</el-button>
      </span>
    </el-dialog>

    <!-- 关注弹窗 -->
    <el-dialog title="关注" :visible.sync="focusOnVisible" width="30%" :show-close="false" :close-on-click-modal="false">
      <a-radio-group v-model="value" @change="getRadioValue">
        <div>
          <span>牌号：</span>
          <a-radio :value="focusOnValue.grade">{{ focusOnLabel.grade }}</a-radio>
        </div>
        <br />
        <div>
          <span>样品规格：</span>
          <a-radio :value="focusOnValue.specification">{{ focusOnLabel.specification }}</a-radio>
        </div>
        <br />
        <div>
          <span>国别：</span>
          <a-radio :value="focusOnValue.country">{{ focusOnLabel.country }}</a-radio>
        </div>
        <br />
        <div>
          <span>生产商：</span>
          <a-radio :value="focusOnValue.manufacturer">{{ focusOnLabel.manufacturer }}</a-radio>
        </div>
        <br />
        <div>
          <span>执行标准：</span>
          <a-radio :value="focusOnValue.standard">{{ focusOnLabel.standard }}</a-radio>
        </div>
        <br />
      </a-radio-group>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" style="margin-right: 20px" @click="confirmFocusOn()">确认关注</el-button>
        <el-button type="danger" size="small" style="margin-right: 20px" @click="closeFocusOn()">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 关注弹窗 -->

    <!-- 测量数据下载弹框 -->
    <el-dialog title="提示" :visible.sync="exportTabDataVisible" width="50%">
      <span>请选择数据格式</span>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
        <!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button> -->
        <el-button type="primary" @click="exportTabData('tab')">Ansys数据导出(.tab)</el-button>
        <el-button type="primary" @click="exportTabData('xlsx')">Comsol数据导出(.xlsx)</el-button>
        <el-button type="primary" @click="exportTabData('txt')">Flux数据导出(.txt)</el-button>
      </div>
    </el-dialog>
    <!-- 测量数据下载弹框 -->
  </div>
</template>

<script>
import * as echarts from 'echarts'
import { Message } from 'element-ui'
import measureStatistics from './components/measureStatistics.vue'
import measureSelect from './components/measureSelect.vue'
import measureDetailed from './components/measureDetailed.vue'
import advancedSearch from './components/advancedSearch.vue'
import fastSearch from './components/fastSearch.vue'
import categoryFilter from './components/categoryFilter.vue'
export default {
  components: {
    measureStatistics,
    measureSelect,
    measureDetailed,
    advancedSearch,
    fastSearch,
    categoryFilter
  },
  data() {
    return {
      /*************** 操作部分 *********************/
      isOperationShow: false,
      /*************** 操作部分 *********************/
      commentId: '', //评论ID
      DataTypeGj: '全部性能', //传入子组件进行判断
      /*************** 关注 *********************/
      focusOnVisible: false,
      value: '',
      focusOnImportData: {
        userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id,
        content: '',
        property: ''
      },
      focusOnLabel: {
        grade: '',
        specification: '',
        country: '',
        manufacturer: '',
        standard: ''
      },
      focusOnValue: {
        grade: '',
        specification: '',
        country: '',
        manufacturer: '',
        standard: ''
      },
      /*************** 关注 *********************/

      dataZoomType: 'slider',
      indexEnlargeStatus: true,
      indexEnlargeXStatus: true,
      indexEnlargeType: '',
      indexEnlargeXtype: '',
      importDataType: '',
      tableRow: {},
      exportMeasureDataId: '',
      xAxisName: '',
      yAxisName: '',
      yAxisAnotherName: '',
      graphWidth: 1350,
      graphHeight: 600,
      GraphOption: {
        sampleSize: '',
        toolbox: {
          show: true,
          feature: {
            dataView: { readOnly: false },
            restore: {},
            saveAsImage: {}
          }
        },
        dataZoom: [
          {
            disabled: false,
            id: 'dataZoomX',
            type: 'slider',
            // top: 'bottom',
            xAxisIndex: [0],
            filterMode: 'empty'
          },
          {
            disabled: false,
            id: 'dataZoomY',
            type: 'slider',
            yAxisIndex: [0],
            filterMode: 'empty'
          }
        ],
        grid: [{ top: 40 , bottom: 100 }], //大概每个legend增加20
        legend: {
          icon: 'none',
          textStyle: {
            color: 'inherit'
          },
          // left: '15%',
          // right: '15%',
          data: [],
          formatter: function(name) {
            return echarts.format.truncateText(name, 1000, '14px Microsoft Yahei', '…')
          },
          tooltip: {
            confine: true,
            show: true,
            formatter: (params, ticket, callback) => {
              let paramsSplit = params.name.split(',')
              let paramsBack = paramsSplit
                .map(x => {
                  return x + `<br />`
                })
                .join('') //这里使用join('')是为了祛除map遍历添加的逗号
              return paramsBack
            }
          }
        },
        tooltip: {
          confine: true,
          formatter: (params, ticket, callback) => {
            if (params.componentIndex % 2 == 0) {
              //偶数-■-
              return this.xAxisName + ':' + params.data[0] + `<br />` + this.yAxisName + ':' + params.data[1]
            } else {
              //奇数-○-
              return this.xAxisName + ':' + params.data[0] + `<br />` + this.yAxisAnotherName + ':' + params.data[1]
            }
          }
        },
        xAxis: {
          name: '',
          // max: 'dataMax',
          nameTextStyle: {
            color: 'skyblue',
            padding: [5, 0, 0, 0]
          },
          nameLocation: 'middle',
          axisLine: {
            onZero: false
          }
        },
        yAxis: [
          {
            name: '',
            position: 'left',
            nameTextStyle: {
              color: 'green'
            },
            axisLine: {
              onZero: false
            }
          },
          {
            name: '',
            show: false,
            position: 'right',
            nameTextStyle: {
              color: 'green'
            },
            axisLine: {
              onZero: false
            }
          }
        ],
        series: []
      },
      measureHead: [], //动态生成表头
      fileFlag: 0,
      dataWithCheck: [],
      hasExist: [],
      noExist: [],
      markList: [],
      doubleMarkList: [], //牌号下拉框的二维数组
      doubleSupplierList: [], //生产商下拉框的二维数组
      //添加国内外相同牌号对话框字段
      markLength: [''],
      selectedMark: [''],
      markValue: [''],
      countryValue: [''],
      //添加材料标签对话框字段
      materialLabelLength: [''],
      materialLabelValue: [''],
      //添加化学成分对话框字段
      chemLength: [''],
      elementValue: [''],
      contentValue: [''],
      //添加生产商
      importSupplier: {
        id: '',
        producer: '',
        country: '',
        address: '',
        email: '',
        website: '',
        telephone: '',
        staff: '',
        fax: '',
        remarks: ''
      },
      //生产商标签
      supplierLabelLength: [''],
      selectedSupplier: [''],
      SupplierLabelValue: [''],
      //样品规格参数
      importSimpeSize: {
        innerDiameter: '', //内径
        outerDiameter: '', //外径
        height: '', //磁环高度
        mass: '', //质量
        primaryTurns: '', //初级绕组匝数
        secondaryTurns: '', //次级绕组匝数
        magneticLengthEff: '', //有效磁路长度(m)
        area: '', //轴向截面积(m^2)
        massDensity: '', //实际质量密度(kg/m^3)
        magneticArea: '', //磁路截面积(m^2)
        ringWidth: '', //环宽(m)
        volume: '', //体积(m^3)
        remarks: '' //备注
      },
      importResultVisible: false,
      importSizeVisible: false,
      importSuppierLabelVisible: false,
      importSuppierVisible: false,
      importChemVisible: false,
      importMetailVisible: false,
      importMarkVisible: false,
      importOneDataVisible: false,
      //downFileName:['供应商标签','软磁动态磁化曲线测量条件表','软磁动态磁滞回线测量条件表','供应商信息','牌号标签','化学成分表信息','软磁动态原始波形测量条件表','软磁动态铁损曲线测量条件表','软磁静态磁化曲线测量条件表','软磁静态铁损曲线测量条件表','软磁静态磁滞回线测量条件表','软磁静态原始波形测量条件表','相同相近牌号','执行标准标签','软磁样品基本参数'],
      downFileName: [
        '软磁样品基本参数',
        '执行标准标签',
        '牌号标签',
        '相同相近牌号',
        '化学成分表信息',
        '供应商信息',
        '供应商标签',
        '软磁静态原始波形测量条件表',
        '软磁动态原始波形测量条件表',
        '软磁静态磁化曲线测量条件表',
        '软磁动态磁化曲线测量条件表',
        '软磁静态磁滞回线测量条件表',
        '软磁动态磁滞回线测量条件表',
        '软磁静态铁损曲线测量条件表',
        '软磁动态铁损曲线测量条件表'
      ],
      paramData: {
        name: '2'
      },
      uploadUrl: 'http://59.172.104.174:30669/admin/uploadLessonFile', //上传文件路径
      importTag: false,
      conditionNum: {},
      likePNG: '@/assets/iconfile/like3.png',
      likeflag: true, //未点赞
      dislikeflag: true, //未踩
      starflag: false, //未收藏
      commentDialog: false,

      chartList: [],
      //评论部分
      isfold: [],
      newComment: '', //新的评论
      flag: -1,
      foldFlag: [],
      reply: '', //评论回复
      comment: [
        {
          name: '巡山啦',
          time: '2021-04-15 17:23',
          content: '这个不错哟！',
          commentNum: 0
        },
        {
          name: '雷伟',
          time: '2021-04-15 17:23',
          content: '这个不错哟！',
          commentNum: 2,
          children: [
            {
              name: '冬哥',
              time: '2021-04-15 17:26',
              content: '雷伟说的对！'
            },
            {
              name: '向钊',
              time: '2021-04-15 17:29',
              content: '我顶！！！'
            }
          ]
        },
        {
          name: '雷伟',
          time: '2021-04-15 17:23',
          content: '这个有点问题呀',
          commentNum: 1,
          children: [
            {
              name: '小明',
              time: '2021-04-15 17:26',
              content: '是的，这条数据有问题'
            }
          ]
        }
      ],
      //控制图表的显示和隐藏
      showChart: false,
      exportTabDataVisible: false,
      // 指定图表的配置项和数据
      measureList: [],
      conditionList: [],
      producer: '',
      mark: '',
      country: '',
      selectNum: '',
      condition: '',
      content: '',
      material: '',
      manufacturer: '',
      curve: '',
      display: '',
      // 分组条件
      conditionOptions: [
        {
          label: '国别',
          value: '1'
        },
        {
          label: '生产商',
          value: '2'
        },
        {
          label: '样品规格',
          value: '3'
        },
        {
          label: '年份',
          value: '4'
        }
      ],
      //分组内容
      contentOptions: [
        {
          label: '中国',
          value: '1'
        },
        {
          label: '美国',
          value: '2'
        },
        {
          label: '俄罗斯',
          value: '3'
        },
        {
          label: '日本',
          value: '4'
        },
        {
          label: '德国',
          value: '5'
        },
        {
          label: '英国',
          value: '6'
        },
        {
          label: '法国',
          value: '7'
        },
        {
          label: '意大利',
          value: '8'
        },
        {
          label: '墨西哥',
          value: '9'
        },
        {
          label: '韩国',
          value: '10'
        },
        {
          label: '瑞典',
          value: '11'
        },
        {
          label: '卢森堡',
          value: '12'
        },
        {
          label: '印度',
          value: '13'
        },
        {
          label: '未知',
          value: '14'
        }
      ],
      //材料标签
      materialOptions: [
        {
          label: '高频电工钢',
          value: '1'
        },
        {
          label: '无底层',
          value: '2'
        },
        {
          label: '通用系列',
          value: '3'
        },
        {
          label: '非晶',
          value: '4'
        },
        {
          label: '超高磁感',
          value: '5'
        },
        {
          label: '高饱和型',
          value: '6'
        },
        {
          label: '去应力退火系列',
          value: '7'
        },
        {
          label: '低噪声',
          value: '8'
        },
        {
          label: '细化磁畴',
          value: '9'
        },
        {
          label: '新能源汽车系列',
          value: '10'
        },
        {
          label: '高磁感型',
          value: '11'
        },
        {
          label: '高效系列',
          value: '12'
        },
        {
          label: '纳米晶',
          value: '13'
        },
        {
          label: '取向电工钢',
          value: '14'
        },
        {
          label: '无取向电工钢',
          value: '15'
        },
        {
          label: '冷轧',
          value: '16'
        },
        {
          label: '低铁损',
          value: '17'
        },
        {
          label: '热轧',
          value: '18'
        },
        {
          label: '高强度电工钢',
          value: '19'
        },
        {
          label: '高硅电工钢',
          value: '20'
        }
      ],
      // 生产商标签
      manufacturerOptions: [
        {
          label: 'SMC',
          value: '1'
        },
        {
          label: '铁氧体',
          value: '2'
        },
        {
          label: '硅钢',
          value: '3'
        },
        {
          label: '永磁',
          value: '4'
        }
      ],
      // 曲线类型
      curveOptions: [
        {
          label: '原始波形',
          value: '原始波形'
        },
        {
          label: '磁滞回线',
          value: '磁滞回线'
        },
        {
          label: '退磁曲线',
          value: '退磁曲线'
        }
      ],
      // 时间形式
      displayOptions: [
        {
          label: '静态',
          value: '静态'
        }
      ],
      total: 10,
      total1: 10,
      queryInfo: {
        pageNum: 1,
        pageSize: 10,
        userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      },
      primaryTableSort: {
        content: 'parameterId',
        sortOrder: 'DASC'
      },
      queryNum: 1,
      advancedSearchData: {
        queryArray: [],
        andOr: ''
      },
      fastSearchData: {
        content: ''
      },
      //测量条件分页
      pageVo: {
        //当前的页数
        pageNum: 1,
        //当前每页显示多少条数据
        pageSize: 10
      },
      conditionInfo: {
        curveTypes: '',
        timeTypes: '',
        productId: ''
      },
      importParamter: {
        //导入一行对话框的数据
        id: '', //主键
        grade: '', //牌号
        specification: '', //样品规格
        country: '', //国别
        standard: '', //执行标准
        manufacturer: '', //生产商
        dataType: '', //数据类型
        nominalDensity: '', //标称密度/(kg/m³)
        materialsType: '', //材料类型
        manufacturingTechnique: '', //生产工艺
        remanence: '', //剩磁Br/
        coercivity: '', //矫顽力Hcb
        intrinsicCoercivity: '', //内禀矫顽力Hcj
        maximumMagnetic: '', //最大磁能积
        specificConductance: '', //电导率
        recoilPermeability: '', //回复磁导率
        heatConductivity: '', //热导率/(W/m-k)
        youngModulus: '', //杨氏模量
        hw: '', //韦氏硬度
        brReversibleTemperature: '', //Br可逆温度系数
        hcjReversibleTemperature: '', //Hcj可逆温度系数
        curiePoint: '', //居里温度
        maximumTemperature: '', //最高工作温度
        projuctGroup: '', //项目组
        cabinetNumber: '', //样品柜编号
        sampleProducer: '', //样品提供人
        inDate: '', //入库日期
        remarks: '', //备注
        state: '' //是否已经审核
      },
      parameterList: [],
      message: {
        name: '',
        time: '',
        content: '',
        dataId: '', //数据id
        parentId: '' //父级id
      },
      supplierList: [],
      standardList: [],
      sizeList: [],
      importTag: false,
      importflag: '',
      testtype: this.$refs.zongHeTable,
      columnShowNameList: [],
      // 写死了 涉及修改太多了
      columnShowList: [
        {
            "value": "parameterId",
            "label": "编号",
            "isShow": true,
        },
        {
            "value": "grade",
            "label": "牌号",
            "isShow": true,
        },
        {
            "value": "country",
            "label": "国别",
            "isShow": true,
        },
        {
            "value": "manufacturer",
            "label": "生产商",
            "isShow": true,
        },
        {
            "value": "standard",
            "label": "执行标准",
            "isShow": true,
        },
        {
            "value": "dataType",
            "label": "数据类型",
            "isShow": true,
        },
        {
            "value": "specification",
            "label": "样品规格",
            "isShow": true,
        },
        {
            "value": "inDate",
            "label": "入库日期",
            "isShow": true,
        },
        {
            "value": "cabinetNumber",
            "label": "样品柜编号",
            "isShow": false,
        },
        {
            "value": "projuctGroup",
            "label": "项目组",
            "isShow": false,
        },
        {
            "value": "sampleProducer",
            "label": "样品提供人",
            "isShow": false,
        },
        {
            "value": "dataSource",
            "label": "数据来源",
            "isShow": true,
        },
        {
            "value": "remarks",
            "label": "备注",
            "isShow": false,
        }
      ],
      chartSpecification: '',
    }
  },
  created() {
    this.loadData()
    Message({
      message: '需勾选某条具体数据，才可查看下方测量条件和详细信息！',
      type: 'warning',
      center: true,
      customClass: 'myMessageClass'
    })
    // this.getOriginMessage()
    // this.getTableColumn()
  },
  computed: {
    indexEnlargeName() {
      return function(status) {
        if (status == true) {
          this.indexEnlargeType = 'primary'
          // &emsp;等于\u2003   代表一个中文文字大小的空格
          return 'semilogy'
        } else {
          this.indexEnlargeType = 'dashed'
          return '关闭semilogy'
        }
      }
    },
    indexEnlargeXName() {
      return function(status) {
        if (status == true) {
          this.indexEnlargeXtype = 'primary'
          // &emsp;等于\u2003   代表一个中文文字大小的空格
          return 'semilogx'
        } else {
          this.indexEnlargeXtype = 'dashed'
          return '关闭semilogx'
        }
      }
    },
    columnHalfNum() {
      return this.columnShowList.length % 2 == 0 ? this.columnShowList.length/2 : this.columnShowList.length/2 + 1
    }
  },
  methods: {
    tableGetSortChange(column) {
      if (column.order == 'ascending') {
        this.primaryTableSort.content = column.prop
        this.primaryTableSort.sortOrder = 'ASC'
      } else if (column.order == 'descending') {
        this.primaryTableSort.content = column.prop
        this.primaryTableSort.sortOrder = 'DASC'
      } else if (column.order == null) {
        this.primaryTableSort.content = 'parameterId'
        this.primaryTableSort.sortOrder = 'ASC'
      }
      this.loadData()
    },
    downloadAttachment(dataName) {
      console.log('dataName----', dataName)
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/attachmentUpload/downLoadAttachmentFile',
        method: 'GET',
        params: {
          filename: dataName
        },
        responseType: 'blob' // 表明返回服务器返回的数据类型
      }).then(res => {
        let blob = new Blob([res.data])
        let fileName = dataName
        if (window.navigator.msSaveOrOpenBlob) {
          navigator.msSaveBlob(blob, fileName)
        } else {
          var link = document.createElement('a')
          link.href = window.URL.createObjectURL(blob)
          link.download = fileName
          link.click()
          //释放内存
          window.URL.revokeObjectURL(link.href)
        }
      })
    },
    downLoadFileName(dataName) {
      console.log('dataName', dataName)
      if(dataName == '未知' || dataName == '') {
        Message({
          message: '数据库暂未收录该消息，欢迎使用附件上传',
          type: 'warning',
          center: true,
          customClass: 'mzindex',
        })
        return
      }
      this.axios({
        baseURL: 'http://59.172.104.174:31770',
        url: '/basicsExecutionStandard/getFilenameByNumber',
        method: 'GET',
        params: {
          number: dataName
        },
      }).then(res => {
        console.log('res----', res.data.result.filename)
        if(res.data.result.filename != '' && res.data.result.filename != null){
          this.downloadAttachment(res.data.result.filename)
        } else {
          Message({
            message: '数据库暂未收录该消息，欢迎使用附件上传',
            type: 'warning',
            center: true,
            customClass: 'mzindex',
          })
        }
      })
    },
    /*************** 关注  *********************/
    getFocusOn(row) {
      this.focusOnLabel.grade = row.grade
      this.focusOnLabel.specification = row.specification
      this.focusOnLabel.country = row.country
      this.focusOnLabel.manufacturer = row.manufacturer
      this.focusOnLabel.standard = row.standard
      this.focusOnValue.grade = 'grade-' + row.grade
      this.focusOnValue.specification = 'specification-' + row.specification
      this.focusOnValue.country = 'country-' + row.country
      this.focusOnValue.manufacturer = 'manufacturer-' + row.manufacturer
      this.focusOnValue.standard = 'standard-' + row.standard
      this.focusOnVisible = true
    },
    confirmFocusOn() {
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/attentionTable/attention',
        method: 'POST',
        data: this.focusOnImportData
      }).then(res => {
        if (res.data.result.code == 300) {
          Message({
            message: res.data.result.message,
            type: 'warning',
            center: true,
            customClass: 'mzindex'
          })
        } else if (res.data.result.code == 200) {
          Message({
            message: res.data.result.message,
            type: 'success',
            center: true,
            customClass: 'mzindex'
          })
        }
      })
      this.focusOnVisible = false
    },
    closeFocusOn() {
      this.focusOnVisible = false
    },
    getRadioValue(e) {
      const strArr = e.target.value.split('-')
      this.focusOnImportData.property = strArr[0]
      this.focusOnImportData.content = strArr[1]
    },
    /*************** 关注  *********************/

    /*************** 快速查询相关函数  *********************/
    resetQueryKs() {
      this.queryInfo.pageNum = 1
      this.queryInfo.pageSize = 10
      this.queryNum = 1
      this.loadData()
    },

    getTableFastResult(content) {
      this.queryNum = 3
      this.fastSearchData.content = content
      this.queryInfo.pageNum = 1
      this.queryInfo.pageSize = 10
      this.$refs.fastSearch.getMySearchHistory()
      this.loadData()
    },
    /*************** 快速查询相关函数  *********************/

    /*************** 高级查询相关函数  *********************/
    resetQuery() {
      this.queryInfo.pageNum = 1
      this.queryInfo.pageSize = 10
      this.queryNum = 1
      this.loadData()
    },
    //获取高级查询组件查询结果
    getTableInquiryResult(queryArray, andOr) {
      this.queryNum = 2
      this.advancedSearchData.queryArray = queryArray
      this.advancedSearchData.andOr = andOr
      this.queryInfo.pageNum = 1
      this.queryInfo.pageSize = 10
      this.loadData()
    },
    //获取主表的ref信息
    getTableRef() {
      this.$refs.advancedSearch.getTableColumn(this.$refs.zongHeTable) //括号内的ref名字记得根据不同表进行修改
    },
    /*************** 高级查询相关函数  *********************/
    // 获取elements表头
    // getTableColumn() {
    //   //通过ref获取el-table的表头数据
    //   let columnTitle = this.$refs.yongCiTable.$children
    //     .filter(x => {
    //       return x._props.prop !== undefined
    //     })
    //     .map(x => {
    //       return new Object({
    //         value: x._props.prop,
    //         label: x._props.label
    //       })
    //     })
    //   this.headeroptions = columnTitle
    //   this.headerCondition.push(columnTitle)
    //   console.log("headeroptions----------",this.headeroptions);
    // },
    // echarts横坐标指数倍放大
    indexEnlarge() {
      if (this.indexEnlargeStatus == true) {
        //开启半对数图
        this.$set(this.GraphOption.yAxis[0], 'type', 'log')
        this.$set(this.GraphOption.yAxis[0], 'logBase', 10)
        this.$set(this.GraphOption.yAxis[0], 'minorTick', {
          show: true
        })
        this.$set(this.GraphOption.yAxis[0], 'minorSplitLine', {
          show: true
        })
        this.indexEnlargeStatus = !this.indexEnlargeStatus
        this.dynamicSetGridAndHeight(this.GraphOption.series)
      } else if (this.indexEnlargeStatus == false) {
        //关闭半对数图
        this.$delete(this.GraphOption.yAxis[0], 'type')
        this.$delete(this.GraphOption.yAxis[0], 'logBase')
        this.$delete(this.GraphOption.yAxis[0], 'minorTick')
        this.$delete(this.GraphOption.yAxis[0], 'minorSplitLine')
        this.indexEnlargeStatus = !this.indexEnlargeStatus
        this.dynamicSetGridAndHeight(this.GraphOption.series)
      }
    },
    indexEnlargeX() {
      // X轴半对数
      if (this.indexEnlargeXStatus == true) {
        this.$set(this.GraphOption.xAxis, 'type', 'log')
        this.$set(this.GraphOption.xAxis, 'logBase', 10)
        this.$set(this.GraphOption.xAxis, 'minorTick', {
          show: true
        })
        this.$set(this.GraphOption.xAxis, 'minorSplitLine', {
          show: true
        })
        this.indexEnlargeXStatus = !this.indexEnlargeXStatus
        this.dynamicSetGridAndHeight(this.GraphOption.series)
      } else if (this.indexEnlargeXStatus == false) {
        this.$delete(this.GraphOption.xAxis, 'type')
        this.$delete(this.GraphOption.xAxis, 'logBase')
        this.$delete(this.GraphOption.xAxis, 'minorTick')
        this.$delete(this.GraphOption.xAxis, 'minorSplitLine')
        this.indexEnlargeXStatus = !this.indexEnlargeXStatus
        this.dynamicSetGridAndHeight(this.GraphOption.series)
      }
    },

    importOneParamter() {},
    handleChange(info) {
      if (info.file.status === 'done') {
        if (info.file.response.code == '201') {
          this.$message.success('重新上传文件成功！')
        } else if (info.file.response.code == '200') {
          this.$message.success('上传文件成功！')
        }
      }
    },

    //测量数据导出按钮
    exportMeasureData() {
      var sampleType = ''
      // var data = new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
      if (this.importDataType == '软磁性能') {
        sampleType = '软磁'
        var data = new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
      } else if (this.importDataType == '永磁性能') {
        sampleType = '永磁'
        var data = new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
      } else if (this.importDataType == '导电性能') {
        sampleType = '导电'
        var data = new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
      } else if (this.importDataType == '传热性能') {
        sampleType = '传热'
        var data = new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
        var data = Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
      }else if (this.importDataType == '机械性能') {
        sampleType = '机械'
      }else if(this.importDataType == "磁致伸缩性能"){
        sampleType = "磁致伸缩"
        console.log("this.conditionInfo.timeTypes111111",this.conditionInfo.timeTypes)
        var data = new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType:  this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification })
      }
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/ExportData/exportData',
        method: 'POST',
        data: data,
        responseType: 'blob'
      }).then(res => {
        console.log('导出的res', res)
        const blob = new Blob([res.data])
        const url = window.URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.style.display = 'none'
        link.download = '测量数据.txt'
        link.href = url
        link.click()
      })
    },

    //tab导出按钮
    exportTabData(suffix) {
      var sampleType = ''
      if (this.importDataType == '软磁性能') {
        sampleType = '软磁'
      } else if (this.importDataType == '永磁性能') {
        sampleType = '永磁'
      } else if (this.importDataType == '导电性能') {
        sampleType = '导电'
      }
      if(suffix !== 'xlsx') {
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: '/ExportData/exportDataTab',
          method: 'POST',
          data: new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification }),
          responseType: 'blob'
        }).then(res => {
          const blob = new Blob([res.data])
          const url = window.URL.createObjectURL(blob)
          const link = document.createElement('a')
          link.style.display = 'none'
          link.download = `${this.tableRow.grade}.${suffix}`
          link.href = url
          link.click()
        })
      } else {
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: '/ExportData/exportDataExcel',
          method: 'POST',
          data: new Object({ id: this.exportMeasureDataId, type: sampleType + '样品基本参数', dataType: sampleType + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, specification: this.tableRow.specification }),
          responseType: 'blob'
        }).then(res => {
          const blob = new Blob([res.data])
          const url = window.URL.createObjectURL(blob)
          const link = document.createElement('a')
          link.style.display = 'none'
          link.download = `${this.tableRow.grade}.${suffix}`
          link.href = url
          link.click()
        })
      }
    },
    //模板导出按钮
    exportData() {
      if (this.fileFlag === -1) return
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: `/admin/downLoadLessonFile?name=${this.downFileName[this.fileFlag]}`,
        methods: 'GET',
        responseType: 'blob'
      }).then(res => {
        const blob = new Blob([res.data])
        const url = window.URL.createObjectURL(blob)
        const link = document.createElement('a')
        link.style.display = 'none'
        link.download = `${this.downFileName[this.fileFlag]}.xlsx`
        link.href = url
        link.click()
      })
    },
    //导入
    showImport(tag, index) {
      this.importTag = true
      this.importflag = tag
      this.fileFlag = index
    },
    showDataImport() {
      if (this.importflag == '样本基本参数') {
        //导入一条对话框
        this.importOneDataVisible = true
      } else if (this.importflag == '国内外相同牌号') {
        //导入国内外相同牌号对话框
        this.importMarkVisible = true
      } else if (this.importflag == '材料标签') {
        //导入材料标签对话框
        this.importMetailVisible = true
      } else if (this.importflag == '化学成分') {
        //导入化学成分对话框
        this.importChemVisible = true
      } else if (this.importflag == '生产商') {
        //导入生产商对话框
        this.importSuppierVisible = true
      } else if (this.importflag == '生产商标签') {
        //导入生产商标签对话框
        this.importSuppierLabelVisible = true
      } else if (this.importflag == '样品规格参数') {
        //导入样品规格参数对话框
        this.importSizeVisible = true
      }
    },

    delMark(index) {
      if (this.markLength.length === 1) return
      this.markLength.splice(index - 1, 1)
      this.selectedMark.splice(index - 1, 1)
      this.doubleMarkList.splice(index - 1, 1)
      this.markValue.splice(index - 1, 1)
      this.countryValue.splice(index - 1, 1)
    },
    addMark() {
      console.log(this.doubleMarkList)
      this.markLength.push('')
      this.doubleMarkList.push(this.markList)
      this.selectedMark.push('')
      this.countryValue.push('')
      this.markValue.push('')
    },
    resetMark() {
      this.importMarkVisible = false
      this.markLength = ['']
      this.selectedMark = ['']
      this.countryValue = ['']
      this.markValue = ['']
    },

    importSomeMark() {
      var markVoList = []
      for (var i = 0; i < this.markLength.length; i++) {
        markVoList.push(
          new Object({
            id: '',
            mark: this.selectedMark[i],
            country: this.countryValue[i],
            alias: this.markValue[i]
          })
        )
      }
      var userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      this.axios({
        baseURL: 'http://59.172.104.174:31770',
        url: '/basicsMarks/importMarkByUser',
        method: 'POST',
        data: {
          userId,
          markVoList
        }
      }).then(res => {
        this.dataWithCheck = res.data.result.dataWithCheck
        this.hasExist = res.data.result.hasExist
        this.noExist = res.data.result.noExist
        this.importResultVisible = true
      })
    },
    addMaterialLabel() {
      this.materialLabelLength.push('')
      this.materialLabelValue.push('')
      this.selectedMark.push('')
      this.doubleMarkList.push(this.markList)
    },
    delMaterialLabel(index) {
      if (this.materialLabelLength.length === 1) return
      this.materialLabelLength.splice(index - 1, 1)
      this.materialLabelValue.splice(index - 1, 1)
      this.selectedMark.splice(index - 1, 1)
      this.doubleMarkList.splice(index - 1, 1)
    },
    resetMaterialLabel() {
      this.importMetailVisible = false
      this.selectedMark = ['']
      this.materialLabelLength = ['']
      this.materialLabelValue = ['']
    },
    importSomeMaterialLabel() {
      var materialLabelVoList = []
      for (var i = 0; i < this.materialLabelLength.length; i++) {
        materialLabelVoList.push(
          new Object({
            id: '',
            mark: this.selectedMark[i],
            producerLabel: this.materialLabelValue[i]
          })
        )
      }
      var userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      this.axios({
        baseURL: 'http://59.172.104.174:31770',
        url: '/basicsMaterialLabel/importMaterialLabelByUser',
        method: 'POST',
        data: {
          userId,
          materialLabelVoList
        }
      })
    },
    addChem() {
      this.chemLength.push('')
      this.elementValue.push('')
      this.contentValue.push('')
      this.selectedMark.push('')
      this.doubleMarkList.push(this.markList)
    },
    delChem() {
      if (this.chemLength.length === 1) return
      this.chemLength.splice(index - 1, 1)
      this.elementValue.splice(index - 1, 1)
      this.contentValue.splice(index - 1, 1)
      this.selectedMark.splice(index - 1, 1)
      this.doubleMarkList.splice(index - 1, 1)
    },
    resetChem() {
      this.importChemVisible = false
      this.chemLength = ['']
      this.selectedMark = ['']
      this.elementValue = ['']
      this.contentValue = ['']
    },
    //导入多条化学成分
    importSomeChem() {
      //化学成分导入
      var chemicalVoList = []
      for (var i = 0; i < this.chemLength.length; i++) {
        chemicalVoList.push(
          new Object({
            id: '',
            mark: this.selectedMark[i],
            numberRange: this.contentValue[i],
            chemicalFormula: this.elementValue[i]
          })
        )
      }
      var userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      this.axios({
        baseURL: 'http://59.172.104.174:31770',
        url: '/basicsChemicalComponent/importChemical',
        method: 'POST',
        data: {
          userId,
          chemicalVoList
        }
      })
    },
    resetSupplier() {
      this.importSupplier.producer = ''
      this.importSupplier.country = ''
      this.importSupplier.address = ''
      this.importSupplier.email = ''
      this.importSupplier.website = ''
      this.importSupplier.telephone = ''
      this.importSupplier.fax = ''
      this.importSupplier.staff = ''
      this.importSupplier.remarks = ''
      this.importSuppierVisible = false
    },
    importOneSupplier() {
      this.importSupplier.userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      this.axios({
        baseURL: 'http://59.172.104.174:31770',
        url: '/basicsProducerInformation/importProducerInformationByUser',
        method: 'POST',
        data: this.importSupplier
      })
    },
    addSupplierLabel() {
      this.supplierLabelLength.push('')
      this.SupplierLabelValue.push('')
      this.selectedSupplier.push('')
      this.doubleSupplierList.push(this.supplierList)
    },
    delSupplierLabel(index) {
      if (this.supplierLabelLength.length === 1) return
      this.supplierLabelLength.splice(index - 1, 1)
      this.SupplierLabelValue.splice(index - 1, 1)
      this.selectedSupplier.splice(index - 1, 1)
      this.doubleSupplierList.splice(index - 1, 1)
    },
    resetSupplierLabel() {
      this.importSuppierLabelVisible = false
      this.supplierLabelLength = ['']
      this.selectedSupplier = ['']
      this.SupplierLabelValue = ['']
    },
    //导入多条化学成分
    importSomeSuppierLabel() {
      //化学成分导入
      var manufacturerLabelVoList = []
      for (var i = 0; i < this.supplierLabelLength.length; i++) {
        manufacturerLabelVoList.push(
          new Object({
            id: '',
            producerLabel: this.SupplierLabelValue[i],
            producer: this.selectedSupplier[i]
          })
        )
      }
      var userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      this.axios({
        baseURL: 'http://59.172.104.174:31770',
        url: '/basicsManufacturerLabel/importManufacturerLabel',
        method: 'POST',
        data: {
          userId,
          manufacturerLabelVoList
        }
      })
    },
    //控制折叠
    foldComment(index) {
      if (this.isfold[index] == false) {
        this.isfold[index] = true
        this.$forceUpdate() //强制渲染
        console.log(this.isfold[index])
      } else {
        this.isfold[index] = false
        this.$forceUpdate() //强制渲染
      }
    },
    //评论部分点击发送按钮
    addComment(it) {
      var comment1 = {}
      comment1.userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      comment1.dataId = it.dataId
      comment1.parentCommentId = it.id
      comment1.nickname = eval('(' + window.localStorage.getItem('pro__Login_Userinfo') + ')').value.realname
      comment1.content = this.reply
      comment1.createTime = ''
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/systemmanagement/comment/commentDataSave',
        method: 'POST',
        data: comment1
      }).then(res => {
        if ((res.data.flag = true)) {
          this.$message.success('评论成功！！！')
          this.getComment(this.commentId)
        }
      })
      this.flag = -1
      this.reply = ''
    },
    addNewComment(id) {
      var comment1 = {}
      comment1.userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      comment1.dataId = id
      comment1.parentCommentId = ''
      comment1.nickname = eval('(' + window.localStorage.getItem('pro__Login_Userinfo') + ')').value.realname
      comment1.content = this.newComment
      comment1.createTime = ''
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/systemmanagement/comment/commentDataSave',
        method: 'POST',
        data: comment1
      }).then(res => {
        if ((res.data.flag = true)) {
          this.$message.success('评论成功！！！')
          this.getComment(this.commentId)
          this.newComment = ''
        }
      })
      this.flag = -1
      this.reply = ''
    },
    //评论部分点击取消按钮
    cancelComment() {
      this.flag = -1
      this.reply = ''
    },
    //点击回复，禁用所有回复
    replyComment(id) {
      this.flag = id
    },
    //子评论的回复
    replyComment1(id) {
      this.flag = id
    },
    //当输入框失去焦点时
    showComment() {
      if (this.commentDetail === '') {
        this.flag = -1
      }
    },
    getComment(rowId) {
      this.commentId = rowId
      this.commentDialog = true
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        method: 'GET',
        url: `/systemmanagement/comment/commentDataList?dataId=${this.commentId}`
      }).then(res => {
        this.comment = res.data.data
        this.comment = this.comment.map(x => {
          x.commentNum = x.replyComments.length
          return x
        })
      })
      for (var i = 0; i < this.comment.length; i++) {
        this.isfold[i] = false
      }
    },
    //获取测量条件
    getCondition() {
      var dataMessage = {}
      var condition = {}
      condition.curveTypes = '永磁' + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes
      condition.productId = this.conditionInfo.productId
      dataMessage.conditionVo = condition
      dataMessage.pageVo = this.pageVo
      dataMessage.userId = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id,
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/measurement/getParameter',
        method: 'post',
        data: dataMessage
      }).then(res => {
        if(res.data.code == 501) {
          this.conditionList = []
          Message({
            message: '暂无权限！',
            type: 'warning',
            center: true,
            customClass: 'mzindex',
          })
          return
        } else {
          this.conditionList = res.data.result.records
          this.total1 = res.data.result.total
        }
      })
    },
    //获取测量数据，渲染echarts
    addChart(arr, rows, nameTitle, exportMeasureDataId, conditionInfo) {
      this.GraphOption.series = []
      this.conditionInfo = conditionInfo
      this.exportMeasureDataId = exportMeasureDataId
      if (arr == '') {
        this.myChart.clear()
      } else if (this.importDataType == '软磁性能') {
        this.myChart = echarts.init(document.getElementById('main'))
        this.myChart.showLoading()
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/productMetricalData/getMaterialData/${this.tableRow.specification}`,
          method: 'POST',
          data: new Object({ type: '软磁' + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, dataId: arr })
        }).then(res => {
          console.log('冬哥的数据', res)
          this.measureHead = []
          // 处理表头数据
          for (let i = 0; i < res.data.result.comments.length; i++) {
            let addData = {
              label: '',
              name: ''
            }
            addData.label = res.data.result.comments[i].label
            addData.name = res.data.result.comments[i].name
            this.measureHead.push(addData)
          }
          // 处理表身数据
          this.measureList = []
          this.measureList = res.data.result.list[res.data.result.list.length - 1]

          //type=1为普通echarts图表，type=2为以频率为横坐标的图表，type=3为以数据个数为横坐标的图表
          if (res.data.result.type == 3) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'Sample Number' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[0].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[1].label + '  -■-' //y2轴
            this.xAxisName = 'Sample Number'
            this.yAxisName = res.data.result.comments[0].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[0].name) {
                    grandsonArrayOne[0] = j
                    grandsonArrayOne[1] = res.data.result.list[i][j][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArrayTwo[0] = j
                    grandsonArrayTwo[1] = res.data.result.list[i][j][k] / zoomYTwo
                  }
                }
                sonArrayOne[j] = grandsonArrayOne
                sonArrayTwo[j] = grandsonArrayTwo
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 2) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'time/s' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[0].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[1].label + '  -■-' //y2轴
            this.xAxisName = 'time/s'
            this.yAxisName = res.data.result.comments[0].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let timeOptions = []
            for (let i = 0; i < rows.length; i++) {
              timeOptions[i] = 1 / rows[i].frequency
            }
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              let jSub = timeOptions[i] / res.data.result.list[i].length
              for (let j = 0, m = 0; j < timeOptions[i]; m++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][m]) {
                  if (k == res.data.result.comments[0].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayOne[0] = timeOptions[i]
                    } else {
                      grandsonArrayOne[0] = j
                    }
                    grandsonArrayOne[1] = res.data.result.list[i][m][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayTwo[0] = timeOptions[i]
                    } else {
                      grandsonArrayTwo[0] = j
                    }
                    grandsonArrayTwo[1] = res.data.result.list[i][m][k] / zoomYTwo
                  }
                }
                sonArrayOne[m] = grandsonArrayOne
                sonArrayTwo[m] = grandsonArrayTwo

                j = j + jSub
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1) {
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[0].label //x轴
            this.GraphOption.yAxis[1].show = false
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label //y轴
            this.xAxisName = res.data.result.comments[0].label
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.xAxis, 'max')
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArray = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArray = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[0].name) {
                    grandsonArray[0] = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArray[1] = res.data.result.list[i][j][k]
                  }
                }
                sonArray[j] = grandsonArray
              }
              let inputParams = {
                name: nameTitle[i],
                data: sonArray,
                type: 'line',
                smooth: false
              }
              this.GraphOption.series.push(inputParams)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          }

          this.dynamicSetGridAndHeight(rows)
        })
      } else if (this.importDataType == '永磁性能') {
        this.myChart = echarts.init(document.getElementById('main'))
        this.myChart.showLoading()
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: '/perMaterialData/getMaterialData',
          method: 'POST',
          data: new Object({ type: '永磁' + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, dataId: arr })
        }).then(res => {
          console.log('冬哥的数据', res)
          this.measureHead = []
          // 处理表头数据
          for (let i = 1; i <= res.data.result.comments.length - 2; i++) {
            let addData = {
              label: '',
              name: ''
            }
            addData.label = res.data.result.comments[i].label
            addData.name = res.data.result.comments[i].name
            this.measureHead.push(addData)
          }
          // 处理表身数据
          this.measureList = []
          if (this.conditionInfo.curveTypes !== '磁滞回线') {
            this.measureList = JSON.parse(JSON.stringify(res.data.result.list[res.data.result.list.length - 1]))
          } else {
            this.measureList = JSON.parse(JSON.stringify(res.data.result.listBt[res.data.result.listBt.length - 1]))
            this.measureList.unshift(...JSON.parse(JSON.stringify(res.data.result.listJt[res.data.result.listJt.length - 1])))
          }
          //type=1为普通echarts图表，type=2为以频率为横坐标的图表，type=3为以数据个数为横坐标的图表
          if (res.data.result.type == 3) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'Sample Number' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'Sample Number'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[2].name) {
                    grandsonArrayOne[0] = j
                    grandsonArrayOne[1] = res.data.result.list[i][j][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArrayTwo[0] = j
                    grandsonArrayTwo[1] = res.data.result.list[i][j][k] / zoomYTwo
                  }
                }
                sonArrayOne[j] = grandsonArrayOne
                sonArrayTwo[j] = grandsonArrayTwo
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 2) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'time/s' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'time/s'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let timeOptions = []
            for (let i = 0; i < rows.length; i++) {
              timeOptions[i] = 1 / rows[i].frequency
            }
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              let jSub = timeOptions[i] / res.data.result.list[i].length
              for (let j = 0, m = 0; j < timeOptions[i]; m++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][m]) {
                  if (k == res.data.result.comments[2].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayOne[0] = timeOptions[i]
                    } else {
                      grandsonArrayOne[0] = j
                    }
                    grandsonArrayOne[1] = res.data.result.list[i][m][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayTwo[0] = timeOptions[i]
                    } else {
                      grandsonArrayTwo[0] = j
                    }
                    grandsonArrayTwo[1] = res.data.result.list[i][m][k] / zoomYTwo
                  }
                }
                sonArrayOne[m] = grandsonArrayOne
                sonArrayTwo[m] = grandsonArrayTwo

                j = j + jSub
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1 && this.conditionInfo.curveTypes == '磁滞回线') {
            // 海工大要求：磁滞回线与退磁曲线只显示第二象限坐标点
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[1].label //x轴
            this.GraphOption.yAxis[1].show = true //是否开启双y轴
            this.GraphOption.yAxis[0].name = res.data.result.comments[2].label + '  ⬤' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[3].label + '  ◆' //y2轴
            this.xAxisName = res.data.result.comments[1].label
            this.yAxisName = res.data.result.comments[2].label
            this.yAxisAnotherName = res.data.result.comments[3].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.listBt.length; i++) {
              var sonArrayOne = []
              var sonArrayOneNum = 0
              for (let j = 0; j < res.data.result.listBt[i].length; j++) {
                var xNum = ''
                var yNumOne = ''
                for (let k in res.data.result.listBt[i][j]) {
                  if (k == res.data.result.comments[1].name) {
                    xNum = res.data.result.listBt[i][j][k]
                  } else if (k == res.data.result.comments[2].name) {
                    yNumOne = res.data.result.listBt[i][j][k]
                  }
                }
                sonArrayOne[sonArrayOneNum] = [xNum, yNumOne]
                sonArrayOneNum++
              }

              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'scatter',
                smooth: false,
                symbol: 'circle',
                symbolSize: 5
              }
              this.GraphOption.series.push(inputParamsOne)
            }
            for (let i = 0; i < res.data.result.listJt.length; i++) {
              var sonArrayTwo = []
              var sonArrayTwoNum = 0
              for (let j = 0; j < res.data.result.listJt[i].length; j++) {
                var xNum = ''
                var yNumTwo = ''
                for (let k in res.data.result.listJt[i][j]) {
                  if (k == res.data.result.comments[1].name) {
                    xNum = res.data.result.listJt[i][j][k]
                  } else if (k == res.data.result.comments[3].name) {
                    yNumTwo = res.data.result.listJt[i][j][k]
                  }
                }
                sonArrayTwo[sonArrayTwoNum] = [xNum, yNumTwo]
                sonArrayTwoNum++
              }

              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'scatter',
                smooth: false,
                symbol: 'diamond',
                symbolSize: 5
              }
              // this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1 && this.conditionInfo.curveTypes == '退磁曲线') {
            // 海工大要求：磁滞回线与退磁曲线只显示第二象限坐标点
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[1].label //x轴
            this.GraphOption.yAxis[1].show = true //是否开启双y轴
            this.GraphOption.yAxis[0].name = res.data.result.comments[2].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[3].label + '  -■-' //y2轴
            this.xAxisName = res.data.result.comments[1].label
            this.yAxisName = res.data.result.comments[2].label
            this.yAxisAnotherName = res.data.result.comments[3].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 0)
            this.$set(this.GraphOption.yAxis[0], 'min', 0)
            this.$set(this.GraphOption.yAxis[1], 'min', 0)

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              var sonArrayOneNum = 0
              var sonArrayTwoNum = 0
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var xNum = ''
                var yNumOne = ''
                var yNumTwo = ''
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[1].name) {
                    xNum = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[2].name) {
                    yNumOne = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[3].name) {
                    yNumTwo = res.data.result.list[i][j][k]
                  }
                }
                sonArrayOne[sonArrayOneNum] = [xNum, yNumOne]
                sonArrayOneNum++
                sonArrayTwo[sonArrayTwoNum] = [xNum, yNumTwo]
                sonArrayTwoNum++
              }

              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          }

          this.dynamicSetGridAndHeight(rows)
        })
      } else if (this.importDataType == '导电性能') {
        this.myChart = echarts.init(document.getElementById('main'))
        this.myChart.showLoading()
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: '/eleData/getMaterialData',
          method: 'POST',
          data: new Object({ type: '导电' + this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, dataId: arr })
        }).then(res => {
          this.measureHead = []
          // 处理表头数据
          for (let i = 1; i < res.data.result.comments.length - 1; i++) {
            let addData = {
              label: '',
              name: ''
            }
            addData.label = res.data.result.comments[i].label
            addData.name = res.data.result.comments[i].name
            this.measureHead.push(addData)
          }
          // 处理表身数据
          this.measureList = []
          this.measureList = res.data.result.list[res.data.result.list.length - 1]

          //type=1为普通echarts图表，type=2为以频率为横坐标的图表，type=3为以数据个数为横坐标的图表
          if (res.data.result.type == 3) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'Sample Number' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'Sample Number'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[2].name) {
                    grandsonArrayOne[0] = j
                    grandsonArrayOne[1] = res.data.result.list[i][j][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArrayTwo[0] = j
                    grandsonArrayTwo[1] = res.data.result.list[i][j][k] / zoomYTwo
                  }
                }
                sonArrayOne[j] = grandsonArrayOne
                sonArrayTwo[j] = grandsonArrayTwo
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 2) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'time/s' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'time/s'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let timeOptions = []
            for (let i = 0; i < rows.length; i++) {
              timeOptions[i] = 1 / rows[i].frequency
            }
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              let jSub = timeOptions[i] / res.data.result.list[i].length
              for (let j = 0, m = 0; j < timeOptions[i]; m++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][m]) {
                  if (k == res.data.result.comments[2].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayOne[0] = timeOptions[i]
                    } else {
                      grandsonArrayOne[0] = j
                    }
                    grandsonArrayOne[1] = res.data.result.list[i][m][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayTwo[0] = timeOptions[i]
                    } else {
                      grandsonArrayTwo[0] = j
                    }
                    grandsonArrayTwo[1] = res.data.result.list[i][m][k] / zoomYTwo
                  }
                }
                sonArrayOne[m] = grandsonArrayOne
                sonArrayTwo[m] = grandsonArrayTwo

                j = j + jSub
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1) {
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[1].label //x轴
            this.GraphOption.yAxis[1].show = false
            this.GraphOption.yAxis[0].name = res.data.result.comments[2].label //y轴
            this.xAxisName = res.data.result.comments[2].label
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.xAxis, 'max')
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }
            this.$set(this.GraphOption.xAxis, 'scale', true)
            this.$set(this.GraphOption.yAxis[0], 'scale', true)
            this.$set(this.GraphOption.yAxis[1], 'scale', true)

            // // 设置x,y轴最大最小值（以最小值0.9倍，最大值1.1倍就行设计）
            // this.$set(this.GraphOption.xAxis, 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.xAxis, 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArray = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArray = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[1].name) {
                    grandsonArray[0] = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[2].name) {
                    grandsonArray[1] = res.data.result.list[i][j][k]
                  }
                }
                sonArray[j] = grandsonArray
              }
              let inputParams = {
                name: nameTitle[i],
                data: sonArray,
                type: 'line',
                smooth: false
              }
              this.GraphOption.series.push(inputParams)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
            console.log('this.GraphOption', this.GraphOption)
          }

          this.dynamicSetGridAndHeight(rows)
        })
      } else if (this.importDataType == '传热性能') {
        this.myChart = echarts.init(document.getElementById('main'))
        this.myChart.showLoading()
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/chuanre/heattransfer-parameter/selectTestData/${this.chartSpecification}`,
          method: 'POST',
          data: new Object({ type: this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, dataId: arr }),
        }).then((res) => {
          this.measureHead = []
          // 处理表头数据
          for (let i = 0; i < res.data.result.comments.length; i++) {
            let addData = {
              label: '',
              name: '',
            }
            addData.label = res.data.result.comments[i].label
            addData.name = res.data.result.comments[i].name
            this.measureHead.push(addData)
          }
          // 处理表身数据
          this.measureList = []
          this.measureList = res.data.result.list[res.data.result.list.length - 1]
          console.log('this.measureHead', this.measureHead)
          console.log('this.measureList', this.measureList)

          //type=1为普通echarts图表，type=2为以频率为横坐标的图表，type=3为以数据个数为横坐标的图表
          if (res.data.result.type == 3) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'Sample Number' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'Sample Number'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            console.log(this.GraphOption.xAxis)
            console.log(this.GraphOption.yAxis)
            console.log(this.xAxisName)
            console.log(this.yAxisName)

            // 缩放为1处理
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[2].name) {
                    grandsonArrayOne[0] = j
                    grandsonArrayOne[1] = res.data.result.list[i][j][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArrayTwo[0] = j
                    grandsonArrayTwo[1] = res.data.result.list[i][j][k] / zoomYTwo
                  }
                }
                sonArrayOne[j] = grandsonArrayOne
                sonArrayTwo[j] = grandsonArrayTwo
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false,
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect',
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 2) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'time/s' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'time/s'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let timeOptions = []
            for (let i = 0; i < rows.length; i++) {
              timeOptions[i] = 1 / rows[i].frequency
            }
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              let jSub = timeOptions[i] / res.data.result.list[i].length
              for (let j = 0, m = 0; j < timeOptions[i]; m++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][m]) {
                  if (k == res.data.result.comments[2].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayOne[0] = timeOptions[i]
                    } else {
                      grandsonArrayOne[0] = j
                    }
                    grandsonArrayOne[1] = res.data.result.list[i][m][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayTwo[0] = timeOptions[i]
                    } else {
                      grandsonArrayTwo[0] = j
                    }
                    grandsonArrayTwo[1] = res.data.result.list[i][m][k] / zoomYTwo
                  }
                }
                sonArrayOne[m] = grandsonArrayOne
                sonArrayTwo[m] = grandsonArrayTwo

                j = j + jSub
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false,
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect',
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1) {
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[0].label //x轴
            this.GraphOption.yAxis[1].show = false
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label //y轴
            this.xAxisName = res.data.result.comments[0].label
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.xAxis, 'max')
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }

            // // 设置x,y轴最大最小值（以最小值0.9倍，最大值1.1倍就行设计）
            // this.$set(this.GraphOption.xAxis, 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.xAxis, 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArray = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArray = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[0].name) {
                    grandsonArray[0] = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArray[1] = res.data.result.list[i][j][k]
                  }
                }
                sonArray[j] = grandsonArray
              }
              let inputParams = {
                name: nameTitle[i],
                data: sonArray,
                type: 'line',
                smooth: false,
              }
              this.GraphOption.series.push(inputParams)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
            console.log('this.GraphOption', this.GraphOption)
          }

          this.dynamicSetGridAndHeight(rows)
        })
      } else if (this.importDataType == '机械性能'){
        this.myChart = echarts.init(document.getElementById('main'))
        this.myChart.showLoading()
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/machine/machine-parameter/selectTestData/${this.chartSpecification}`,
          method: 'POST',
          data: new Object({ type:  this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, dataId: arr })
        }).then(res => {
          this.measureHead = []
          // 处理表头数据
          for (let i = 0; i < res.data.result.comments.length; i++) {
            let addData = {
              label: '',
              name: ''
            }
            addData.label = res.data.result.comments[i].label
            addData.name = res.data.result.comments[i].name
            this.measureHead.push(addData)
          }
          // 处理表身数据
          this.measureList = []
          this.measureList = res.data.result.list[res.data.result.list.length - 1]

          //type=1为普通echarts图表，type=2为以频率为横坐标的图表，type=3为以数据个数为横坐标的图表
          if (res.data.result.type == 3) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'Sample Number' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'Sample Number'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[2].name) {
                    grandsonArrayOne[0] = j
                    grandsonArrayOne[1] = res.data.result.list[i][j][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArrayTwo[0] = j
                    grandsonArrayTwo[1] = res.data.result.list[i][j][k] / zoomYTwo
                  }
                }
                sonArrayOne[j] = grandsonArrayOne
                sonArrayTwo[j] = grandsonArrayTwo
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 2) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'time/s' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'time/s'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let timeOptions = []
            for (let i = 0; i < rows.length; i++) {
              timeOptions[i] = 1 / rows[i].frequency
            }
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              let jSub = timeOptions[i] / res.data.result.list[i].length
              for (let j = 0, m = 0; j < timeOptions[i]; m++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][m]) {
                  if (k == res.data.result.comments[2].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayOne[0] = timeOptions[i]
                    } else {
                      grandsonArrayOne[0] = j
                    }
                    grandsonArrayOne[1] = res.data.result.list[i][m][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayTwo[0] = timeOptions[i]
                    } else {
                      grandsonArrayTwo[0] = j
                    }
                    grandsonArrayTwo[1] = res.data.result.list[i][m][k] / zoomYTwo
                  }
                }
                sonArrayOne[m] = grandsonArrayOne
                sonArrayTwo[m] = grandsonArrayTwo

                j = j + jSub
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1) {
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[0].label //x轴
            this.GraphOption.yAxis[1].show = false
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label //y轴
            this.xAxisName = res.data.result.comments[1].label
            this.yAxisName = res.data.result.comments[0].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.xAxis, 'max')
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }
            this.$set(this.GraphOption.xAxis, 'scale', true)
            this.$set(this.GraphOption.yAxis[0], 'scale', true)
            this.$set(this.GraphOption.yAxis[1], 'scale', true)

            // // 设置x,y轴最大最小值（以最小值0.9倍，最大值1.1倍就行设计）
            // this.$set(this.GraphOption.xAxis, 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.xAxis, 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArray = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArray = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[0].name) {
                    grandsonArray[0] = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArray[1] = res.data.result.list[i][j][k]
                  }
                }
                sonArray[j] = grandsonArray
              }
              let inputParams = {
                name: nameTitle[i],
                data: sonArray,
                type: 'line',
                smooth: false
              }
              this.GraphOption.series.push(inputParams)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
            console.log('this.GraphOption', this.GraphOption)
          }

          this.dynamicSetGridAndHeight(rows)
        })

      } else if(this.importDataType == "磁致伸缩性能"){
        this.myChart = echarts.init(document.getElementById('main'))
        this.myChart.showLoading()
        console.log("this.chartSpecification------",this.chartSpecification)
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/cizhi/magnetostriction-parameter/selectTestData/${this.chartSpecification}`,
          method: 'POST',
          data: new Object({ type:  this.conditionInfo.timeTypes + this.conditionInfo.curveTypes, dataId: arr })
        }).then(res => {
          this.measureHead = []
          // 处理表头数据
          for (let i = 0; i < res.data.result.comments.length; i++) {
            let addData = {
              label: '',
              name: ''
            }
            addData.label = res.data.result.comments[i].label
            addData.name = res.data.result.comments[i].name
            this.measureHead.push(addData)
          }
          // 处理表身数据
          this.measureList = []
          this.measureList = res.data.result.list[res.data.result.list.length - 1]

          //type=1为普通echarts图表，type=2为以频率为横坐标的图表，type=3为以数据个数为横坐标的图表
          if (res.data.result.type == 3) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'Sample Number' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'Sample Number'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[2].name) {
                    grandsonArrayOne[0] = j
                    grandsonArrayOne[1] = res.data.result.list[i][j][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArrayTwo[0] = j
                    grandsonArrayTwo[1] = res.data.result.list[i][j][k] / zoomYTwo
                  }
                }
                sonArrayOne[j] = grandsonArrayOne
                sonArrayTwo[j] = grandsonArrayTwo
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 2) {
            // 处理echarts表x、y1、y2轴名称
            this.GraphOption.xAxis.name = 'time/s' //x轴
            this.GraphOption.yAxis[1].show = true
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label + '  -○-' //y1轴
            this.GraphOption.yAxis[1].name = res.data.result.comments[2].label + '  -■-' //y2轴
            this.xAxisName = 'time/s'
            this.yAxisName = res.data.result.comments[1].label
            this.yAxisAnotherName = res.data.result.comments[2].label
            if (this.GraphOption.xAxis.min != undefined) {
              this.$delete(this.GraphOption.xAxis, 'min')
            }
            this.$set(this.GraphOption.xAxis, 'max', 'dataMax')
            this.$set(this.GraphOption.yAxis[0], 'max', 1)
            this.$set(this.GraphOption.yAxis[0], 'min', -1)
            this.$set(this.GraphOption.yAxis[1], 'max', 1)
            this.$set(this.GraphOption.yAxis[1], 'min', -1)

            // 缩放为1处理
            let timeOptions = []
            for (let i = 0; i < rows.length; i++) {
              timeOptions[i] = 1 / rows[i].frequency
            }
            let zoomYOne = res.data.result.maxY
            let zoomYTwo = res.data.result.maxX

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArrayOne = []
              var sonArrayTwo = []
              let jSub = timeOptions[i] / res.data.result.list[i].length
              for (let j = 0, m = 0; j < timeOptions[i]; m++) {
                var grandsonArrayOne = []
                var grandsonArrayTwo = []
                for (let k in res.data.result.list[i][m]) {
                  if (k == res.data.result.comments[2].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayOne[0] = timeOptions[i]
                    } else {
                      grandsonArrayOne[0] = j
                    }
                    grandsonArrayOne[1] = res.data.result.list[i][m][k] / zoomYOne
                  } else if (k == res.data.result.comments[1].name) {
                    if (m == res.data.result.list[i].length - 1) {
                      // 定死x轴坐标最大值
                      grandsonArrayTwo[0] = timeOptions[i]
                    } else {
                      grandsonArrayTwo[0] = j
                    }
                    grandsonArrayTwo[1] = res.data.result.list[i][m][k] / zoomYTwo
                  }
                }
                sonArrayOne[m] = grandsonArrayOne
                sonArrayTwo[m] = grandsonArrayTwo

                j = j + jSub
              }
              let inputParamsOne = {
                name: nameTitle[i],
                data: sonArrayOne,
                type: 'line',
                smooth: false
              }
              let inputParamsTwo = {
                name: nameTitle[i],
                data: sonArrayTwo,
                type: 'line',
                smooth: false,
                symbol: 'rect'
                // colorBy: 'series',
                // itemStyle: {
                //   color: this.randColor(),
                // },
              }
              this.GraphOption.series.push(inputParamsOne)
              this.GraphOption.series.push(inputParamsTwo)
            }
            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
          } else if (res.data.result.type == 1) {
            // 处理echarts表x、y轴名称
            this.GraphOption.xAxis.name = res.data.result.comments[0].label //x轴
            this.GraphOption.yAxis[1].show = false
            this.GraphOption.yAxis[0].name = res.data.result.comments[1].label //y轴
            this.xAxisName = res.data.result.comments[1].label
            this.yAxisName = res.data.result.comments[0].label
            this.yAxisAnotherName = res.data.result.comments[1].label
            if (this.GraphOption.yAxis[0].max != undefined) {
              this.$delete(this.GraphOption.xAxis, 'max')
              this.$delete(this.GraphOption.yAxis[0], 'max')
              this.$delete(this.GraphOption.yAxis[0], 'min')
              this.$delete(this.GraphOption.yAxis[1], 'max')
              this.$delete(this.GraphOption.yAxis[1], 'min')
            }
            this.$set(this.GraphOption.xAxis, 'scale', true)
            this.$set(this.GraphOption.yAxis[0], 'scale', true)
            this.$set(this.GraphOption.yAxis[1], 'scale', true)

            // // 设置x,y轴最大最小值（以最小值0.9倍，最大值1.1倍就行设计）
            // this.$set(this.GraphOption.xAxis, 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.xAxis, 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'max', function (value) {
            //   var num = 0
            //   if (value.max.toString().split('.')[1] != undefined) {
            //     num = value.max.toString().split('.')[1].length
            //   }
            //   if (value.max >= 0) {
            //     return (value.max * 1.1).toFixed(num)
            //   } else {
            //     return (value.max * 0.9).toFixed(num)
            //   }
            // })
            // this.$set(this.GraphOption.yAxis[0], 'min', function (value) {
            //   var num = 0
            //   if (value.min.toString().split('.')[1] != undefined) {
            //     num = value.min.toString().split('.')[1].length
            //   }
            //   if (value.min < 0) {
            //     return (value.min * 1.1).toFixed(num)
            //   } else {
            //     return (value.min * 0.9).toFixed(num)
            //   }
            // })

            // 处理echarts表series数据
            for (let i = 0; i < res.data.result.list.length; i++) {
              var sonArray = []
              for (let j = 0; j < res.data.result.list[i].length; j++) {
                var grandsonArray = []
                for (let k in res.data.result.list[i][j]) {
                  if (k == res.data.result.comments[0].name) {
                    grandsonArray[0] = res.data.result.list[i][j][k]
                  } else if (k == res.data.result.comments[1].name) {
                    grandsonArray[1] = res.data.result.list[i][j][k]
                  }
                }
                sonArray[j] = grandsonArray
              }
              let inputParams = {
                name: nameTitle[i],
                data: sonArray,
                type: 'line',
                smooth: false
              }
              this.GraphOption.series.push(inputParams)
            }

            // 处理echarts表legend数据
            this.GraphOption.legend.data = nameTitle
            console.log('this.GraphOption', this.GraphOption)
          }

          this.dynamicSetGridAndHeight(rows)
        })
      }
    },
    // 随机生成一个rgb颜色
    randColor() {
      let colorw = `rgb(${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)},${Math.round(Math.random() * 255)})`
      return colorw
    },
    dynamicSetGridAndHeight(rows) {
      let legendNum = rows.length
      if (legendNum == 0) {
        this.GraphOption.grid[0].top = 40
        this.graphHeight = 600
      } else {
        this.GraphOption.grid[0].top = 30 + 20 * legendNum + Math.trunc(legendNum / 10) * 20
        this.graphHeight = 600 + 20 * (legendNum - 1)
      }
      this.$nextTick(() => {
        this.drawChart(this.graphHeight)
      })
    },
    // 切换缩放模式
    changeDataZoom(dataZoomType) {
      console.log("dataZoomType-----------------",dataZoomType);
      if(dataZoomType == 'slider') {
        this.dataZoomType = 'inside'
        this.GraphOption.dataZoom[0].type = 'inside'
        this.GraphOption.dataZoom[1].type = 'inside'
      } else {
        this.dataZoomType = 'slider'
        this.GraphOption.dataZoom[0].type = 'slider'
        this.GraphOption.dataZoom[1].type = 'slider'
      }
      this.myChart.setOption(this.GraphOption)
    },
    drawChart(relHeight) {
      this.myChart.clear()
      this.myChart.hideLoading()
      this.myChart.setOption(this.GraphOption)
      const autoHeight = relHeight
      // myChart.getDom().style.height = autoHeight + 'px'
      this.myChart.resize()
    },
    showGraph() {
      if (this.conditionInfo.curveTypes !== '' && this.conditionInfo.timeTypes !== '' && this.conditionInfo.productId !== '') {
        this.getCondition()
      }
    },
    //勾选一项的事件
    parameterSelect(selection, row) {
      // console.log(selection,row);
      if(selection.length < 1) {
        this.$refs.measureDetailed.unSelected(true)
      } else {
        this.$refs.measureDetailed.unSelected(false)
      }
      if (selection.length > 1) {
        this.$refs.zongHeTable.clearSelection()
        selection.shift()
        this.$refs.zongHeTable.toggleRowSelection(row)
      }
      // // 高亮当前行
      // this.$refs.zongHeTable.setCurrentRow(row)

      this.tableRow = row
      this.importDataType = row.dataType
      if (row.dataType == '软磁性能') {
        this.axios({
          //获取数量
          baseURL: 'http://59.172.104.174:30669',
          url: `/productParameter/selectNum?id=${row.id}`,
          methods: 'GET'
        }).then(res => {
          this.conditionNum = res.data.result
        })
        this.producerDetail = {
          producer: '',
          country: '',
          address: '',
          email: '',
          website: '',
          telephone: '',
          fax: ''
        }
        this.sampleSize = row.specification
        this.conditionInfo.productId = row.id
        this.mark = row.grade
        this.country = row.country
        this.producer = row.manufacturer
        this.selectNum = row.parameterId
        if (this.myChart !== undefined) {
          this.myChart.clear()
        }
        this.$refs.measureSelect.getDataFromUp(this.conditionInfo, this.sampleSize)
        this.$refs.measureDetailed.getDetailMessage(row.dataType, row.specification, this.mark, this.country, this.producer, this.conditionInfo, this.selectNum)
        // this.showGraph()
      } else if (row.dataType == '永磁性能') {
        this.axios({
          //获取数量
          baseURL: 'http://59.172.104.174:30669',
          url: `/measurement/selectNum?id=${row.id}`,
          methods: 'GET'
        }).then(res => {
          this.conditionNum = res.data.result
        })
        this.producerDetail = {
          producer: '',
          country: '',
          address: '',
          email: '',
          website: '',
          telephone: '',
          fax: ''
        }
        this.sampleSize = row.specification
        this.conditionInfo.productId = row.id
        this.mark = row.grade
        this.country = row.country
        this.producer = row.manufacturer
        this.selectNum = row.parameterId
        if (this.myChart !== undefined) {
          this.myChart.clear()
        }
        this.$refs.measureSelect.getDataFromUp(this.conditionInfo, this.sampleSize)
        this.$refs.measureDetailed.getDetailMessage(row.dataType, row.specification, this.mark, this.country, this.producer, this.conditionInfo, this.selectNum)
        // this.showGraph()
      } else if (row.dataType == '导电性能') {
        this.axios({
          //获取数量
          baseURL: 'http://59.172.104.174:30669',
          url: `/eleMeasurement/selectNum?id=${row.id}`,
          methods: 'GET'
        }).then(res => {
          this.conditionNum = res.data.result
        })
        this.producerDetail = {
          producer: '',
          country: '',
          address: '',
          email: '',
          website: '',
          telephone: '',
          fax: ''
        }
        this.sampleSize = row.specification
        this.conditionInfo.productId = row.id
        this.mark = row.grade
        this.country = row.country
        this.producer = row.manufacturer
        this.selectNum = row.parameterId
        if (this.myChart !== undefined) {
          this.myChart.clear()
        }
        this.$refs.measureSelect.getDataFromUp(this.conditionInfo, this.sampleSize)
        this.$refs.measureDetailed.getDetailMessage(row.dataType, row.specification, this.mark, this.country, this.producer, this.conditionInfo, this.selectNum)
        // this.showGraph()
      } else if (row.dataType == '传热性能') {
        this.axios({
          //获取数量
          baseURL: 'http://59.172.104.174:30669',
          url: `/chuanre/heattransfer-parameter/selectNum?id=${row.id}`,
          methods: 'GET',
        }).then((res) => {
          this.conditionNum = res.data.result
        })
        this.producerDetail = {
          producer: '',
          country: '',
          address: '',
          email: '',
          website: '',
          telephone: '',
          fax: '',
          staff: '',
          remarks: '',
        }
        this.sampleSize = row.specification
        this.conditionInfo.productId = row.id
        this.mark = row.grade
        this.country = row.country
        this.producer = row.manufacturer
        this.selectNum = row.parameterId
        this.chartSpecification = row.specification
        if (this.myChart !== undefined) {
          this.myChart.clear()
        }
        this.$refs.measureSelect.getDataFromUp(this.conditionInfo, this.sampleSize)
        this.$refs.measureDetailed.getDetailMessage(row.dataType, row.specification, this.mark, this.country, this.producer, this.conditionInfo, this.selectNum)
        // this.showGraph()
      }else if (row.dataType == '机械性能') {
        this.axios({
          //获取数量
          baseURL: 'http://59.172.104.174:30669',
          url: `/machine/machine-parameter/selectNum?id=${row.id}`,
          methods: 'GET'
        }).then(res => {
          this.conditionNum = res.data.result
        })
        this.producerDetail = {
        producer: '',
        country: '',
        address: '',
        email: '',
        website: '',
        telephone: '',
        fax: '',
        staff: '',
        remarks: '',
      }
      this.sampleSize = row.specification
      this.conditionInfo.productId = row.id
      this.mark = row.grade
      this.country = row.country
      this.producer = row.manufacturer
      this.selectNum = row.parameterId
      this.chartSpecification = row.specification
      if (this.myChart !== undefined) {
          this.myChart.clear()
        }
        this.$refs.measureSelect.getDataFromUp(this.conditionInfo, this.sampleSize)
        this.$refs.measureDetailed.getDetailMessage(row.dataType, row.specification, this.mark, this.country, this.producer, this.conditionInfo, this.selectNum)
      }else if(row.dataType == "磁致伸缩性能"){
        this.axios({
        //获取数量
        baseURL: 'http://59.172.104.174:30669',
        url: `/cizhi/magnetostriction-parameter/selectNum?id=${row.id}`,
        methods: 'GET',
      }).then((res) => {
        console.log("获取到数据",res.data.result)
        this.conditionNum = res.data.result
      })
      this.producerDetail = {
          producer: '',
          country: '',
          address: '',
          email: '',
          website: '',
          telephone: '',
          fax: ''
        }
        this.sampleSize = row.specification
        this.conditionInfo.productId = row.id
        this.mark = row.grade
        this.country = row.country
        this.producer = row.manufacturer
        this.selectNum = row.parameterId
        this.chartSpecification = row.specification
        if (this.myChart !== undefined) {
          this.myChart.clear()
        }
        this.$refs.measureSelect.getDataFromUp(this.conditionInfo, this.sampleSize)
        this.$refs.measureDetailed.getDetailMessage(row.dataType, row.specification, this.mark, this.country, this.producer, this.conditionInfo, this.selectNum)
        // this.showGraph()
      }
    },
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize
      this.loadData()
    },
    handleCurrentChange(newPage) {
      this.queryInfo.pageNum = newPage
      this.loadData()
    },
    loadData() {
      var obj = {
        superPageVo: {
          pageNum: this.queryInfo.pageNum,
          pageSize: this.queryInfo.pageSize,
          userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
        },
        advancedVo: {
          pageNum: this.queryInfo.pageNum,
          pageSize: this.queryInfo.pageSize,
          queryArray: this.advancedSearchData.queryArray,
          type: '',
          andOr: this.advancedSearchData.andOr,
          userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
        },
        searchPageVo: {
          pageNum: this.queryInfo.pageNum,
          pageSize: this.queryInfo.pageSize,
          content: this.fastSearchData.content,
          userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id 
        },
        num: this.queryNum,
        content: this.primaryTableSort.content,
        sortOrder: this.primaryTableSort.sortOrder
      }
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/all-parameter/getAllParameter',
        method: 'POST',
        data: obj
      }).then(res => {
        this.parameterList = res.data.result.records
        this.total = res.data.result.total
      })
    },
    operationShow() {
      console.log("isOperationShow---",this.isOperationShow)
      this.isOperationShow = !this.isOperationShow
      var operationDiv = document.getElementsByClassName('el-table__fixed-right')[0]
      if(this.isOperationShow == true) {
        operationDiv.style.display = 'block'
      } else {
        operationDiv.style.display = 'none'
      }
      console.log(operationDiv.style)
      console.log("isOperationShow---",this.isOperationShow)
    },
    // 自定义列
    tableColumnShow(item) {
      this.$set(item, 'isShow', !item.isShow)
      // console.log("columnShowNameList---",this.columnShowNameList)
    },
    // 自定义列————默认勾选
    defaultTableColumnShow() {
      console.log('----------defaultTableColumnShow---------');
      for(var i = 0; i < this.columnShowList.length; i++){
        if(this.columnShowList[i].label == '样品柜编号' || this.columnShowList[i].label == '项目组' || this.columnShowList[i].label == '样品提供人' || this.columnShowList[i].label == '备注' ||
          this.columnShowList[i].label == '电导率/(S/m)' || this.columnShowList[i].label == '热导率/(W/m-k)' || this.columnShowList[i].label == '屈服强度/MPa' || this.columnShowList[i].label == '居里温度/Cel.Deg.' ){
          this.columnShowList[i].isShow = false
        } else {
          this.columnShowList[i].isShow = true
        }
      }
      this.columnShowNameList = [ '编号', '牌号', '国别', '生产商', '执行标准', '标称密度/(kg/m³)', '孔隙率', '单片厚度', '标称叠压系数', '饱和磁密/T', '饱和磁致伸缩系数/ppm', '数据类型', '样品规格', '入库日期', '数据来源' ]
      // console.log("columnShowNameList---",this.columnShowNameList)
    },
    // 自定义列————全部勾选
    allTableColumnShow() {
      console.log('----------allTableColumnShow---------');
      for(var i = 0; i < this.columnShowList.length; i++){
        this.columnShowList[i].isShow = true
      }
      this.columnShowNameList = [ '编号', '牌号', '国别', '生产商', '执行标准', '标称密度/(kg/m³)', '孔隙率', '单片厚度', '标称叠压系数', '饱和磁密/T', '饱和磁致伸缩系数/ppm', '数据类型', '样品规格', '入库日期', '样品柜编号', '项目组', '样品提供人', '数据来源', '备注' ]
      // console.log("columnShowNameList---",this.columnShowNameList)
    },
    renderHeader(h, { column, $index }) {
      // console.log(h, column, $index);
      const label = column.label;
      return [
        h(
          "el-tooltip",
          {
            props: {
              content: (function() {
                return label;
              })(),
              placement: "top",
            },
          },
          [h("span", {}, label)]
        ),
      ];
    },
  }
}
</script>

<style scoped>
.el-divider--horizontal {
  font-weight: 100;
  display: block;
  height: 1px;
  width: 100%;
  margin: 10px 0;
}
/*去除顶部标头的选择框*/
.el-table >>> .DisabledSelection .cell .el-checkbox__inner {
  display: none;
  position: relative;
}
/*修改el-table中排序小三角样式*/
::v-deep .el-table .caret-wrapper {
  height: 45px;
}
::v-deep .el-table .sort-caret {
  border: 7px solid transparent;
}
::v-deep .el-table .sort-caret.ascending {
  border-bottom-color: #c0c4cc;
  top: 5px;
}
::v-deep .el-table .sort-caret.descending {
  border-top-color: #c0c4cc;
  bottom: 7px;
}
::v-deep .descending .sort-caret.descending {
  border-top-color: #4e9efd;
}
::v-deep .ascending .sort-caret.ascending {
  border-bottom-color: #4e9efd;
}
</style>
</style>

<style lang="less" scoped>
/deep/.mainTable.el-table th > .cell {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  white-space: nowrap;
  -webkit-box-orient: vertical;
  word-break: break-all;
  height: 50px;
  line-height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}
/deep/.mainTable.el-table--border th.el-table__cell, .mainTable.el-table__fixed-right-patch {
  background: rgb(250, 250, 250);
}
.mainTable{
  /deep/.caret-wrapper {
    display: none;
  }
  /deep/.sortableShow .caret-wrapper {
    display: block;
  }
}
/deep/.mainTable.el-table__fixed-right {
  border-left: 1px solid #ebeef5;
}
.tableColumnDiv{
  /deep/label.el-checkbox {
    display: flex;
    align-items: center;
  }
  /deep/.el-checkbox__label {
    flex: 1;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: rgba(0,0,0,.65) !important;
  }
  /deep/.el-checkbox__input.is-checked+.el-checkbox__label {
    flex: 1;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: rgba(0,0,0,.65) !important;
  }
  /deep/label.el-checkbox:nth-child(2n) {
    margin-right: 0;
  }
  /deep/label.el-checkbox:nth-child(2n-1) {
    margin-right: 20px;
  }
}
</style>
